﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Reddit.Data
{
    [DataContract]
    public class Comment
    {
        [DataMember]
        public string body { get; set; }

        [DataMember]
        public string name { get; set; }

        [DataMember]
        public string author { get; set; }

        [DataMember]
        public int downs { get; set; }

        [DataMember]
        public double created { get; set; }

        [DataMember]
        public double created_utc { get; set; }

        [DataMember]
        public string body_html { get; set; }

        private string _link_id;
        [DataMember]
        public string link_id 
        {
            get { return _link_id; }
            set { _link_id = Util.NameToId(value); }
        }

        private string _parent_id;
        [DataMember]
        public string parent_id
        {
            get { return _parent_id; }
            set { _parent_id = Util.NameToId(value); }
        }

        [DataMember]
        public bool? likes { get; set; }

        [DataMember]
        public CommentCollection replies { get; set; }

        [DataMember]
        public string id { get; set; }

        [DataMember]
        public int ups { get; set; }
    }
}
